<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    //获取项目名
    String path = request.getContextPath();
    //获取tomcat 协议+地址+端口号+ 获取项目名
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    //获取tomcat 协议+地址+端口号
    String imgPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/img/";

%>
<html>
<head>
    <link rel="icon" href="img/logo.jpg">
    <meta charset="UTF-8">
    <title>订单</title>
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="order_head">
    <div class="head_background">
        <div class="head_box">
            <a href="index1" class="head_left_a"><img src="img/logo.jpg" alt="" class="head_left_p"></a>
            <h1 class="head_h1">${user.uname }的订单</h1>
            <div class="head_right">
                <span class="head_right_in"> ${user.uname }/${user.username } </span>
                <span class="head_right_in">|</span>
                <a href="" class="head_right_in">${user.uname }的订单</a>
            </div>
        </div>
    </div>
</div>
<div class="trolley_background">
    <div class="trolley_background_in">

        <div class="tro_tab_h1">
            <div class="col tro_tab_img" STYLE="margin-left: 30px">
                <img src="img/success.png" alt="">
            </div>
            <div class="col tro_tab_name">
                <li class="tro_tab_name_li1" style="font-size: 30px;">订单生成成功咯！</li>
            </div>
        </div>
        <hr>
        <div class="tro_tab_h1" style="height: 150px;">
            <div class="col tro_tab_name">
                <li class="tro_tab_name_li1" style="font-size: 16px; margin-left: 35px;height: 50px;">
                    订单号：${order.ordersNumber}</li>
                <li class="tro_tab_name_li1" style="font-size: 16px; margin-left: 35px;height: 50px;">
                    用户名称：${user.uname}</li>
                <li class="tro_tab_name_li1" style="font-size: 16px; margin-left: 35px;height: 50px;">
                    订单状态：${order.getstringState()}</li>
            </div>
        </div>


    </div>
    <div class="tro_close_bot ">
        <!--<p class="tro_bot_ppp">+</p>-->
        <p class="tro_close_p_c">合计:<span id="close">${order.sumPrice }</span>元</p>
    </div>
</div>
<jsp:include page="footer.jsp"></jsp:include>
</body>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript">

    //去结算点击的方法
    function pay(sum_price, goods_count, tids) {
        alert(tids);
        //做金额或者件数的非空判断
        if (sum_price == 0 || goods_count == 0) {
            alert("请先购物消费吧，小伙子or小妞~");
            window.location = "index?func=indexInfo";
        } else {
            window.location = "createOrders?sumPrice=" + sum_price + "&goodsCount=" + goods_count;
        }
    }

    //删除购物车的方法
    function deleteTrolley(tid) {
        if (confirm("确定要删除吗？？？")) {
            window.location = "deleteTrolley?tid=" + tid;
        }
    }

    //修改购物车中商品数量的代码
    function addOrDeleteNumber(tid, number) {
        //判断临界情况
        if (number < 1) {
            number = 1;
            //为中间显示商品数量的输入框重新赋值
            $("#num").val(number);
            alert("商品数量不能小于1，如果你不想买了，请删除此条记录");
            return;
        }
        if (number > 5) {
            number = 5;
            $("#num").val(number);
            alert("每人限购五件，库存不足~");
            return;
        }
        window.location = "addOrDeleteNumber?tid=" + tid + "&number=" + number;
    }

</script>
</html>


















